﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Battleship.Stability
{
    class StabilityResult
    {
        private double limitHeelingMoment;
        private double HeelingMoment;

        public StabilityResult(double lcp1, double lcp2, double displacement, double HeelingMoment)
        {
            double Lcp = (lcp1 < lcp2) ? lcp1 : lcp2;
            this.limitHeelingMoment = Lcp * displacement;
            this.HeelingMoment = HeelingMoment;
        }

        public double safetyCoefficient()
        {
            return this.limitHeelingMoment / this.HeelingMoment;
        }

        public Boolean isSafety()
        {
            return safetyCoefficient() >= 1;
        }
    }
}
